package net.opentsdb.core;

/**
 * @author Hujf
 * @title: Const
 * @date 2021-09-22 10:46
 * @description: 常量类
 */
public final class Const {
    public static final short TIMESTAMP_BYTES = 4;

    /**
     * When this bit is set, the value is a floating point value.
     * Otherwise it's an integer value.
     */
    public static final short FLAG_FLOAT = 0x8;

    /** Mask to verify a timestamp on 4 bytes in seconds */
    public static final long SECOND_MASK = 0xFFFFFFFF00000000L;

    /** Max time delta (in seconds) we can store in a column qualifier.  */
    public static final short MAX_TIMESPAN = 3600;

    /** Number of LSBs in time_deltas reserved for flags.  */
    public static final short MS_FLAG_BITS = 6;

    /** Flag to set on millisecond qualifier timestamps */
    public static final int MS_FLAG = 0xF0000000;

    /** Mask to select the size of a value from the qualifier.  */
    public static final short LENGTH_MASK = 0x7;

    /** Mask to select all the FLAG_BITS.  */
    public static final short FLAGS_MASK = FLAG_FLOAT | LENGTH_MASK;

    /** Number of LSBs in time_deltas reserved for flags.  */
    public static final short FLAG_BITS = 4;

    private static int SALT_WIDTH = 0;
    public static int SALT_WIDTH(){
        return SALT_WIDTH;
    }
}
